import { Radio, RadioChangeEvent } from "antd";
import { useState } from "react";
import LinkTable from "./components/LinkTable";
import CommentList from "./components/CommentList";

export default function Link() {
  const [activeKey, setActiveKey] = useState("0");
  return (
    <div className="page__wrap--g">
      <div className="form__wrap--g">
        <Radio.Group
          size="middle"
          options={[
            { label: "友链列表", value: "0" },
            { label: "友链评论", value: "1" },
          ]}
          onChange={({ target: { value } }: RadioChangeEvent) => {
            setActiveKey(value);
          }}
          value={activeKey}
          optionType="button"
          buttonStyle="solid"
        />
      </div>
      <div className="table__wrap--g no-page">
        {" "}
        {activeKey === "0" ? <LinkTable /> : <CommentList />}
      </div>
    </div>
  );
}
